package com.lin.cloud.disk.common.entity.request;

import com.lin.cloud.disk.entity.dto.UserDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * @program: blog
 * @description: 分页请求实体类
 * @author: Lin
 * @create: 2020-12-12 23:22
 **/
@Data
public class PageAccountRequest {
    @ApiModelProperty(value = "当前页", name = "pageNum")
    private Integer pageNum = 1;
    @ApiModelProperty(value = "当前数量", name = "pageSize")
    private Integer pageSize = 20;

    @ApiModelProperty(value = "账户实体类", name = "userDTO",hidden = true)
    @NotNull(message = "userDTO不能为空")
    private UserDTO userDTO;


    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        if (null == pageNum || 0 == pageNum){
            this.pageNum = 1;
            return;
        }
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        if (null == pageSize || 0 == pageSize){
            this.pageSize = 20;
            return;
        }
        this.pageSize = pageSize;
    }
}
